package cn.iocoder.yudao.module.api.member.growth.enums;

import cn.hutool.core.util.EnumUtil;
import cn.iocoder.yudao.framework.business.basic.enums.EnumValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * 用户贡献值的业务类型枚举
 *
 * @author 山野羡民
 */
@AllArgsConstructor
@Getter
public enum MemberGrowthBizTypeEnum implements EnumValuable {

    VIP_PAID(10, "直推【{}】成为会员", "直推【{}】成为会员，获得【{}个】贡献值", true),
    VIP_EXPIRED(11, "直推【{}】会员过期", "直推【{}】会员过期，失去【{}个】贡献值", false),
    ;

    private final Integer value;
    private final String name;
    private final String summary;
    private final boolean add;

    public static MemberGrowthBizTypeEnum valueOf(Integer value) {
        return EnumUtil.getBy(MemberGrowthBizTypeEnum.class,
                e -> Objects.equals(value, e.getValue()));
    }

}
